
extends Area2D

var player_in_range:bool=false


func _on_body_entered(body) -> void:
	if body.name =="player":
		player_in_range=true

func _on_body_exited(body) -> void:
	if body.name =="player":
		player_in_range=false
		
func _input(event):
	if event.is_action_pressed("pick_up") and player_in_range and GameUtiles.move_allow:
		SeManager.play_door()
		GameUtiles.move_allow = false
		await get_tree().create_timer(3.0).timeout
		DialogueManager.show_dialogue_balloon(load("res://dialogues/dia_in_levels/end.dialogue"),"door")
		
		
